package com.study.designmodes.service.liabilityChain.v4;

import com.study.designmodes.service.liabilityChain.v4.bean.Student;
import org.springframework.stereotype.Service;

/**
 * @author yangyanbin
 * @since 20230323
 **/
@Service
public class HaveBreakfastSlot extends AbstractLinkedProcessorSlot<Student> {
    /**
     * 处理过程
     *
     * @param student 上下文
     */
    @Override
    protected void doProcess(Student student) {
        // 是否已经洗头了
        if (student.isWashHair()) {
            // 去吃早饭
            student.setHaveBreakfast(true);
            System.out.println(student.getName() + "吃完早饭");
        }
        System.out.println("可以去上学了！");

    }

    /**
     * 校验
     *
     * @param param
     */
    @Override
    public void validate(Student param) {

    }
}
